var work={
	/*·····························初始化························*/
	init:function(){
		this.eventListen();
		$(".inTel").text(info.tel);
	},
	/*·····························事件监听························*/
	eventListen:function(){
		// 创建用户
		$(document).on("click","#createCustomer",function(){
			$.post("/index.php?m=Admin&c=Customer&a=add",{tel:info.tel},function(data){
				if(data.stat==1){
					work.layerOpen('创建用户','/index.php?m=Service&c=Center&a=create&tel='+info.tel+'&customerId='+data.id);
				}else{
					layer.msg(data.msg);
				}
			});
		});
		//查看用户
		$(document).on("click",".divBtnL",function(){
			var uid=$(this).attr("uid");
			work.layerCap('/index.php?m=Service&c=Center&a=getCustomer&id='+uid,'800px','600px');
		});
			//搜索
		$(document).on("click","#search",function(){
			var tel=$("#searchTel").val();
			var name=$("#searchName").val();
			window.location.href='/index.php?m=Service&c=Center&a=choice&tel='+tel+'&name='+name;
		});
	},
	/*·····························功能性函数························*/
	// iframe页面弹窗
	layerOpen:function(title,url){
		layer.open({
			type: 2,
			area: ['800px', '600px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: title,
			content:url,
		});
	},
	//创建用户
	layerCap:function(url,w,h){
		var w=(w)?w:'800px';
		var h=(h)?h:'400px';
		layer.open({
			type:2,
			shade: false,
		    title: false, //不显示标题
		    area: [w,h],
		    content: url, //捕获的元素
		    cancel: function(index){
		        
		    }
		});
	}
}